cmake_minimum_required (VERSION 2.6)

project (qia)

find_package (Qt4 REQUIRED)
include (${QT_USE_FILE})
include (${CMAKE_CURRENT_SOURCE_DIR}/cmake/FindIconv.cmake)

cmake_policy(SET CMP0003 NEW)

enable_language (CXX)
enable_language (C)

if (NOT WIN32)
    add_definitions (-DLINUX)
else (NOT WIN32)
    add_definitions (-DWIN32)
endif (NOT WIN32)

add_subdirectory (libs)
add_subdirectory (src)
add_subdirectory (images)

if (UNIX AND NOT APPLE)
    install (FILES COPYING DESTINATION share/qia)
    install (FILES ChangeLog DESTINATION share/qia)
endif (UNIX AND NOT APPLE)

########### Add uninstall target ###############
CONFIGURE_FILE(
        "${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in"
        "${CMAKE_CURRENT_BINARY_DIR}/cmake/cmake_uninstall.cmake"
        IMMEDIATE @ONLY)
ADD_CUSTOM_TARGET(uninstall
        "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake/cmake_uninstall.cmake")

set (CPACK_GENERATOR "TGZ;DEB;RPM")

set (CPACK_PACKAGE_DESCRIPTION_SUMMARY "Cross-platform authorization program for Stargazer billing system")
set (CPACK_PACKAGE_VENDOR "STGSoft")
#set (CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/ReadMe.txt")
set (CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/COPYING")
set (CPACK_PACKAGE_VERSION_MAJOR "1")
set (CPACK_PACKAGE_VERSION_MINOR "3")
set (CPACK_PACKAGE_VERSION_PATCH "2")
set (CPACK_SYSTEM_NAME "i386")
set (CPACK_STRIP_FILES "bin/qia")

set (CPACK_DEBIAN_PACKAGE_MAINTAINER "Maxim Mamontov <faust@stg.dp.ua>")
set (CPACK_PACKAGE_DESCRIPTION "Cross-platform authorization program for Stargazer billing system")
set (CPACK_PACKAGE_DESCRIPTION_SUMMARY "Stargazer client")
set (CPACK_DEBIAN_PACKAGE_DEPENDS "libc6 (>= 2.4), libgcc1 (>= 1:4.1.1), libqtcore4 (>= 4.4.1), libqtgui4 (>= 4.4.1), libstdc++6 (>= 4.1.1), libx11-6, libxext6")
set (CPACK_DEBIAN_PACKAGE_SECTION "net")
set (CPACK_DEBIAN_PACKAGE_VERSION "1.3")

include (CPack)
